package com.talent.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.talent.common.PageConstants;
import com.talent.dao.OpenStatusMapper;
import com.talent.page.Page;
import com.talent.pojo.OpenStatus;
import com.talent.service.OpenStatusService;
@Service
public class OpenStatusServiceImpl implements OpenStatusService{

	@Autowired
	private OpenStatusMapper openStatusMapper;
	@Override
	public Page<OpenStatus> findPage(OpenStatus openStatus, int currentPage) {
		Page<OpenStatus> page = new Page<>(currentPage, PageConstants.PAGESIZE);
        List<OpenStatus> openStatusList = openStatusMapper.selectOpenStatusPage(openStatus, page);
        page.setResultList(openStatusList);
        return page;
	}
	@Override
	public int openStatus(Integer id) {
		// 开放权限
		return openStatusMapper.openStatus(id);
	}
	@Override
	public int closeStatus(Integer id) {
		// 关闭权限
		return openStatusMapper.closeStatus(id);
	}
	@Override
	public int selectStatusById(int tpId) {
		int sta =tpId;
		return openStatusMapper.selectStatusById(sta);
	}
}
